package com.last.controller;

import com.last.bean.SearchBean;
import com.last.entity.City;
import com.last.entity.PageResult;
import com.last.service.ISearchService;
import com.last.service.impl.SearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
public class SearchController {
    @Autowired
    private ISearchService iSearchService;

    @PostMapping("search")
    public PageResult<SearchBean> searchByWhere(@RequestBody Map<String,String> searchMap){
        return  iSearchService.searchByWhere(searchMap);
    }

    @GetMapping("gainCity")
    public List<City> gainCity(){
        return iSearchService.gainALlCity();
    }

}
